package lesson

import (
	"github.com/gogf/gf/v2/frame/g"
	"server/api"
	"server/internal/model"
)

type ArticleCreateReq struct {
	g.Meta     `path:"/lesson/article/create" tags:"教学模块-文章" method:"post" summary:"新增" description:"新增文章"`
	CategoryId int64  `v:"" dc:"上级ID"`
	Title      string `v:"required"`
	Summary    string `v:""`
	ZhContent  string `v:""`
	EnContent  string `v:""`
}
type ArticleCreateRes struct {
	ID int64 `json:"id"`
}

type ArticleUpdateReq struct {
	g.Meta     `path:"/lesson/article/update" tags:"教学模块-文章" method:"post" summary:"编辑" description:"编辑文章"`
	ID         int64  `v:"required"`
	CategoryId int64  `v:"" dc:"上级ID"`
	Title      string `v:"required"`
	Summary    string `v:""`
	ZhContent  string `v:""`
	EnContent  string `v:""`
}
type ArticleUpdateRes struct {
	Result int64 `json:"result"`
}

type ArticleDeleteReq struct {
	g.Meta `path:"/lesson/article/delete" tags:"教学模块-文章" method:"post" summary:"删除" description:"删除文章"`
	ID     int64 `v:"required"`
}
type ArticleDeleteRes struct {
	Result int64 `json:"result"`
}

type ArticleListReq struct {
	g.Meta `path:"/lesson/article/list" tags:"教学模块-文章" method:"GET" summary:"列表" description:"文章列表"`
	api.PagerReq
}
type ArticleListRes struct {
	Total int                           `json:"total"`
	List  []model.LessonArticleListItem `json:"list"`
}
